<template lang="pug">
  div.membership-card-record
    div.title {{record.mname}}
    div.content
        div
            div.title {{record.pname}}
            div.time {{record.createtime|timeFilter}}
        div.price {{record.state==0?'-':'+'}}￥{{record.amount|priceFilter}}
</template>
<script>
import moment from "moment";

export default {
  props: ["record"],
  filters: {
    timeFilter(time) {
      return moment(time, 'X').format("YYYY-MM-DD HH:mm:ss");
    },
    priceFilter(price) {
      return (price / 100).toFixed(2);
    }
  }
};
</script>

<style lang="stylus" scoped>
.membership-card-record {
    display: block;
    background-color: #fff;
    font-size: 0.3rem;
    line-height: 0.5rem;

    >.title {
        padding: 0.2rem 0.3rem 0.1rem 0.3rem;
        font-weight: bold;
        border-bottom: solid 1px #eee;
    }

    .content {
        padding: 0.1rem 0.3rem 0.2rem 0.3rem;
        display: flex;
        justify-content: space-between;
        align-items: center;

        .price {
            color: #ac0e0e;
        }
    }
}
</style>
